<template>
  <div>
    <Header @show="showDialog"></Header>
    <Main ref="main"></Main>
    <Dialog v-if="isVisible" ref="ref" @close="closeDialog" ></Dialog>
  </div>
</template>

<script>
import Header from "./component/header.vue";
import Main from "./component/main.vue";
import Dialog from "./component/dialog.vue";
export default {
  components: {
    Header,
    Main,
    Dialog,
  },
  data() {
    return {
      isVisible: false,
    };
  },
  methods: {
    showDialog() {
      this.isVisible = true;
      this.$nextTick(() => {
        this.$refs.ref.openDialog();
      });
    },
    closeDialog() {
      this.isVisible = false;
      this.$nextTick(() => {
        this.$refs.main.getAxios();
      });
    },
  },
};
</script>

<style lang="scss" scoped>

</style>